package com.itheima.util;

// 线程变量工具类
public class CurrentHolder {

    private static ThreadLocal<Integer> threadLocal = new ThreadLocal<>();

    /**
     * 添加
     */
    public static void setCurrentId(Integer value){
        threadLocal.set(value);
    }


    /**
     * 获取
     */
    public static Integer getCurrentId(){
        return threadLocal.get();
    }


    /**
     * 删除
     */
    public static void remove(){
        threadLocal.remove();
    }
}
